home *** CD-ROM | disk | FTP | other *** search
/ Network CD 1 / Network CD.iso / tbag / 1-10 / tb7 / doc-files / cli.docs < prev    next >
Text File  |  1986-09-11  |  14KB  |  307 lines

  1.  
  2. =======================================================================
  3.  
  4. CLI.docs
  5.  
  6. =======================================================================
  7. ************************     ConMan v0.95     **************************
  8.  
  9. ConMan is a replacement console handler that provides line editing and
  10. command line histories.  It runs under AmigaDOS (V1.1 or V1.2) and is
  11. completely transparent to any application program that uses CON: windows.
  12. Programs that use RAW: input are unaffected.
  13.  
  14. Once installed, any windows opened by AmigaDOS will automatically open
  15. using the ConMan handler.  This includes command windows opened by 
  16. NEWCLI as well as any data input/output windows that your program uses.
  17.  
  18. New features have been added to v095B, including support for the "Close"
  19. gadget and a limited function key capability.  One nasty bug has been
  20. fixed:  no checking for "buffer full" was done in the prior version, so
  21. if you typed more than 160 characters you got a visit from you-know-who.
  22.  
  23.  
  24. Line Editing.
  25. The DELETE and BACKSPACE keys function in the usual manner.  The arrow keys
  26. may be used for cursor positioning.  The shifted left arrow moves the cursor
  27. to the beginning of the line, and the shift right arrow moves to the end.  
  28.  
  29. The default input mode inserts characters at the cursor; overstrike may 
  30. be toggled by CTRL-A.  CTRL-X deletes the whole line, while CTRL-Y
  31. deletes from the cursor position to the end of the line.
  32. Tabs are replaced by blanks, so you can back up over them properly.
  33.  
  34. Command History.
  35. Previously-entered lines may be recalled using the up-arrow.  Lines are
  36. retrieved sequentially; if you go past the one you want, the down-arrow
  37. key will back up one.  Shift up-arrow goes to the oldest line, and shift
  38. down-arrow positions the pointer to the most recent line.  The current
  39. history buffer holds twenty input lines; this can be easily changed, once
  40. I document the procedural calls to the ConHandler library.
  41.  
  42. Lines may also be recalled using the function keys (this will be the
  43. default F-key action).  Each key will recall the corresponding line
  44. from the history buffer (excepted that I've temporarily usurped F1 & F2).
  45.  
  46.  
  47. Window definition.
  48. ConMan supports the usual DOS window specification string.  For example,
  49. "CON:160/50/320/100/MyWindow" specifies a window 320x100 pixels in size,
  50. beginning in position (160,50).  ConMan also accepts a specification in
  51. the form "CON:w20480", where the hex digits following the "w" are the
  52. absolute address of an Intuition window pointer.  If you're writing in
  53. 'C', the following sequence would serve to open a window and attach a
  54. DOS console to it:
  55.  
  56.       window = OpenWindow(&newwindow);   /* get a window          */
  57.       sprintf(buffer,"CON:X%x",window);  /* build the name string */
  58.       file  = Open(buffer,MODE_OLDFILE); /* open a console stream */ 
  59.  
  60. The more arcane method of passing the window pointer to the handler
  61. (as in Andy Finkel's Window example) should also work, but I haven't
  62. tried it yet. (Let me know, if someone tries it).
  63.  
  64. Late-breaking news: at the suggestion of John Toebes, I've added the
  65. ability to select which gadgets and attributes your window will have.
  66. Here's how it works:  Put another slash ('/') after the window title,
  67. and follow it with any of the attribute options below:
  68.    A ==> activate             (def: no activate)
  69.    B ==> BackDrop             (def: not BackDrop)
  70.    C ==> Close gadget         (def: no gadget) (action not implemented)
  71.    D ==> Depth gadget         (def: depth gadget)
  72.    M ==> Move (drag) gadget   (def: drag gadget)
  73.    N ==> NoBorder             (def: border) (sorry, 'B' was used)
  74.    R ==> Refresh mode         (def: SMART_REFRESH)
  75.    S ==> Sizing gadget        (def: sizing gadget)
  76.    Z ==> Zero-Zero            (def: not GZZ) (does anybody use this?)
  77.  
  78. Each attribute serves to TOGGLE the corresponding windows flag, so adding
  79. it twice will cancel the effect.  A closing slash is optional.  For those
  80. of you who wanted a slash in your titles:  sorry.
  81.  
  82. Example: CON:10/10/300/100/Behind/nb/  creates a borderless backdrop window.
  83.          CON:10/10/300/100/Fixed/acm   creates an active window, with a
  84.                                        close gadget, that won't budge.
  85.  
  86. One more addition: specifying CON:s123abc/10/10/300/100/ will attach
  87. your window to the specified CUSTOMSCREEN.  I only tried it on the
  88. workbench screen, though (by digging the screen pointer out of
  89. IntuitionBase).  Let me know if it works on real custom screens.
  90.  
  91. Question:  does anyone want to pass in a Super-Bitmap pointer?  If so,
  92. suggest a reasonable syntax that doesn't clash with the above ...
  93.  
  94.  
  95. Installation.
  96. ConMan requires that two files be copied to your SYS: disk (don't worry,
  97. they're both small.)  "My-Handler" (144 bytes) must be placed in
  98. the SYS:L directory, to keep all those bigger handlers company.  The
  99. file "conhandler.library" (4328 bytes) must be placed in the your LIBS:
  100. directory, which is normally SYS:LIBS.  Once these files are present,
  101. execute ConMan (852 bytes) to install the handler.  This file only needs
  102. to be run once (e.g. from your startup-sequence); it allocates 20 bytes
  103. of memory for the handler name string which won't be returned (there are
  104. no provisions in DOS for removing handlers, anyway.)  The ARCed files
  105. have shortened names, so be sure to rename "conlib.lib" and "myhandlr."
  106. A simple "install" script is included to copy files.
  107.  
  108. Distribution.
  109. This program is to be distributed as shareware to Amigoid life-forms 
  110. everywhere!  Make sure your friends get a copy.  Comments and contributions
  111. will be appreciated and may be sent to:
  112.  
  113.       William S. Hawes        (bix: whawes)
  114.       P.O. Box 308
  115.       Maynard, MA 01754
  116.       (617) 568-8695
  117.  
  118. Further Notes.
  119. This Beta version still has some debugging code in it.  Function key F1
  120. toggles a flag that causes a DisplayBeep everytime a WaitForChar packet
  121. is dispatched.  Most programs will not use the WaitForChar function,
  122. since a Read to a CON: device will block until characters are available
  123. anyway.  F2 toggles a flag that DisplayBeeps whenever a "break" signal is
  124. passed on (i.e. is applied to your hapless task).  Also, an extraneous
  125. message port (called 'MyCon) will appear in the Ports list.  These testing
  126. features will go away shortly.
  127.  
  128. The program was developed and tested under V1.2; at least one V1.1
  129. dependency was found and fixed (DoIO to the console device scratched D7).
  130. Let me know if other problems exist.  I spent a lot of time making it
  131. work using the DOS handler-loading mechanism so that it would be backwards
  132. compatible.
  133.  
  134. ConMan does not pre-allocate a history buffer for the commands, but
  135. rather allocates just enough for each string.  This means that the 
  136. available memory changes after every command ... the memory isn't lost,
  137. but it makes it difficult to tell if a program under development is
  138. misbehaving.  This will be changed in the next release.
  139.  
  140. Some of the things I'm thinking about adding include:
  141.    -- Support for the function keys and help keys.  I'm designing a 
  142.       general-purpose data structure to support context-sensitive 
  143.       function and help key definitions.  Keys should support both
  144.       string-substitution and event-type actions.  Any ideas in these
  145.       directions?
  146.  
  147.    -- The ConMan handler is built as a standard shared library.  Various
  148.       entry points will be brought out and documented, and procedural
  149.       calls will be available to manipulate the internal data structures.
  150.       This will allow you to retrieve the window pointer by something
  151.       straightforward like "window = ConsoleWindow(filehandle);".
  152.       I may even write the binding routines for calls from 'C' ... 
  153.  
  154.    -- Most of the support for switchable CON:/RAW: operation is in place.
  155.       I still have to check on a few things (like, what was that new packet
  156.       type, anyway?)
  157.  
  158.    -- How about adding a "dynamic piping" capability, so that an I/O
  159.       stream could be diverted on the fly into (or out of) a file?  Ideas?
  160.  
  161.    -- I plan to release the source code (in assembler) once things are
  162.       cleaned up a bit.  It will be very helpful to anyone needing to
  163.       write a DOS handler.  In the meantime, take a look at the included
  164.       "handler.asm" file:  it provides a simple way around the problem 
  165.       of writing BCPL look-alike programs.  
  166.  
  167.    -- Another tip:  debugging handlers is easy if you try the following 
  168.       trick.  Run the handler program as a normal process under your 
  169.       favorite debugger.  Have it open a public message port, which can
  170.       located by a test driver running separately.  The driver now 
  171.       installs your processid ("pr_MsgPort, obtained by following the
  172.       MP_SIGTASK trail from your public port) in its "pr_ConsoleTask" slot,
  173.       and then does an Open('*',MODE_OLDFILE).  Voila!  Any I/O done by
  174.       the driver comes under the scrutiny of your debugger.  You can 
  175.       get things working before having to worry about installing the
  176.       handler in a device node.  (An occasional message collision will
  177.       occur, since the debugger is probably doing I/O through the 
  178.       processid message port.  Not to worry ...)
  179.  
  180.    -- Look for a super-whiz-bang display manager from the Software
  181.       Distillery in the near future.  I've passed along the source code
  182.       to John Toebes et al; they've got plans for a window manager to
  183.       rival those found on the pricey workstations.
  184.  
  185.                                    -- WSH (4/18/87)
  186. =======================================================================
  187.  
  188.  * DEFDISK
  189.  *
  190.  * A program to make a specified disk/directory the default system disk.
  191.  * It accomplishes this by resetting the DOS library structures to point
  192.  * to the new path. To use this program you will need to compile it as
  193.  * follows:
  194.  *        1> cc defdisk
  195.  *        1> ln defdisk.o -lc
  196.  *
  197.  * Real simple.  I used AZTEC C v3.40a, but I think that 3.30c or later would
  198.  * also work.  It should be possible to compile & build it under LATTICE as
  199.  * well, though I haven't tried.  Once the program is built, put it on your
  200.  * Workbench boot disk somewhere, load up your ram: disk or hard disk and
  201.  *
  202.  *        1> defdisk dh0:
  203.  *              or
  204.  *        1> defdisk dh0:bin
  205.  *
  206.  * Woila! the standard workbench assignments are now pointed at the hard
  207.  * disk. (SYS, C, L, DEVS, LIBS, FONTS)  The advantage to me in using this
  208.  * is that I don't have to load the Amiga DOS assign program 6 times to
  209.  * point the system at the hard disk.
  210.  *
  211.  * Author: J. K. Levie
  212.  *
  213.  * Version 1.0 31-Mar-1987
  214.  */
  215.  
  216. =======================================================================
  217. /** SetPrefs
  218. *
  219. *   SetPrefs, Copyright (C) 1987 by W.G.J. Langeveld
  220. *
  221. *   Description:
  222. *   ------------
  223. *       Have you ever had the problem that you reassigned all your system 
  224. *       directories to your hard disk or to another floppy or to your re-
  225. *       coverable ram disk, and at some point changed and saved your Pre-
  226. *       ferences, but to the wrong place?   So that when you have to boot
  227. *       you wind up with  the same old preferences that AmigaDOS picks up
  228. *       from the system-configuration file on the floppy you boot from?
  229. *           If so, this is a program for you. You run it in your startup-
  230. *       sequence AFTER you have reassigned especially devs: to your other
  231. *       device. This program will then read the system-configuration file
  232. *       in the new devs: directory and set your default preferences accor-
  233. *       dingly.
  234. *           Moreover,  if you just want to use  the preferences from some
  235. *       other disk or  file, you can  specify it on  the command line: in 
  236. *       that case the  program will  search for the specified file rather
  237. *       than 'devs:system-configuration'.
  238. *
  239. *   Examples of use:
  240. *   ----------------
  241. *   (1) A sample startup-sequence might look like:
  242. *
  243. *       assign C: hd0:c
  244. *       assign S: hd0:s
  245. *       assign L: hd0:l
  246. *       assign FONTS: hd0:fonts
  247. *       assign DEVS: hd0:devs
  248. *       assign LIBS: hd0:libs
  249. *       assign SYS: hd0:
  250. *
  251. *       echo "Everything reassigned"
  252. *
  253. *       SetPrefs
  254. *
  255. *   (2) Suppose I  would like to  have the colors I get when booting from
  256. *       my DrofNats program disk, but don't want to boot from it. I could
  257. *       either get into Preferences  and set the colors from memory, or I
  258. *       could type from the CLI:
  259. *
  260. *       1> SetPrefs DrofNats:devs/system-configuration
  261. *
  262. *       If the DrofNats disk  is not in a drive, AmigaDOS will prompt you
  263. *       to insert it.
  264. *
  265. *   (3) Suppose I have a hard disk (I don't)  but would like to change the
  266. *       set-up on occasion,   because e.g.  sometimes I  use  a  different
  267. *       monitor than other times. One might have several system-configura-
  268. *       tion files stashed  away someplace,  and change to any one of them 
  269. *       by typing from the CLI:
  270. *
  271. *       1> SetPrefs :configfiles/config25
  272. *
  273. *       You can make config files by going into preferences, saving them
  274. *       and copying the resulting system-configuration file (Preferences
  275. *       always writes to devs:system-configuration):
  276. *
  277. *       1> copy devs:system-configuration :configfiles/config25
  278. *
  279. *
  280. *   Have fun!
  281. *               Willy.
  282. *
  283.       ***On this disk the examples are in Utilities/SP directory***
  284. ========================================================================
  285.  
  286.  IconType
  287.  
  288.   A useful utility for changing the type of an icon after editing with IconEd.
  289.  
  290.   The "Kick" icon type is not supported, mainly because I can't see a use for
  291. it. If you have a use, let me know, and I'll put it in. Typing the command name
  292. by itself or with a "?" for an argument will print a short "usage" message.
  293.  
  294.   Please note that if you change the type of an icon that is currently
  295. displayed in a window, the window must be closed, then re-opened before you
  296. will see any change in the "INFO" for that icon.
  297.  
  298.   Usage is as follows:
  299.  
  300. IconType clock.info project  (change "clock.info" to a "project" icon)
  301. IconType tools.info drawer   (change "tools.info" to a "drawer" icon )
  302.  
  303.   Valid icon types are Disk, Drawer, Tool, Project, Garbage, and Device.
  304.  
  305. =====================================================================
  306.  
  307.